import java.util.Arrays;
import java.util.Scanner;

/**
 * @author panjunan <panjunan@kuaishou.com>
 * Created on 2021-03-02
 */
public class Mian {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        scan.next();
        while (scan.hasNext()) {
            int m = 0, n = 0;
            n = scan.nextInt();
            m = scan.nextInt();
            int[] f = new int[n];
            boolean flag = true;
            for (int i = 0; i < n; i++) {
                String s = scan.next();
                flag &= s.equals("PERFECT");
            }

            System.out.println(flag ? "MILLION Master"
                    : "NA Noob");
        }

    }
}
